package com.hzd.entity;

import jodd.json.meta.JSON;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * 租客
 *
 * @author Kent
 * @date 2015/8/17.
 */
@Entity
public class Tenant extends BaseEntity {

    @Id
    @Column(length = 32)
    private String id;

    /**
     * openid
     */
    private String openid;

    /**
     * 姓名
     */
    @Column(length = 32)
    private String name;

    /**
     * 身份证号
     */
    @Column(length = 64)
    private String idNo;

    /**
     * 手机号
     */
    @Column(length = 16)
    private String mobileNo;

    /**
     * 租房地址
     */
    @Column(length = 256)
    private String address;

    /**
     * 租金
     */
    @Column(length = 19, scale = 4)
    private BigDecimal rent;

    /**
     * 交租日期
     */
    @Column(length = 16)
    private String rentDate;

    /**
     * 付款方式
     */
    @Column(length = 32)
    private String paymentMethod;

    /**
     * 推荐人
     */
    @Column(length = 32)
    private String referrer;

    /**
     * 收入
     */
    private BigDecimal income;

    /**
     * 支出
     */
    private BigDecimal expense;

    @Transient
    private String verifyCode;

    /**
     * 提交申请是否来自活动
     */
    @Transient
    private boolean fromAcivityFlag;


    //---------------------------- getter setter -------------------------------


    public String getId() {
        return id;
    }

    public Tenant setId(String id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public Tenant setName(String name) {
        this.name = name;
        return this;
    }

    public String getIdNo() {
        return idNo;
    }

    public Tenant setIdNo(String idNo) {
        this.idNo = idNo;
        return this;
    }

    public String getMobileNo() {
        return mobileNo;
    }

    public Tenant setMobileNo(String mobileNo) {
        this.mobileNo = mobileNo;
        return this;
    }

    public String getAddress() {
        return address;
    }

    public Tenant setAddress(String address) {
        this.address = address;
        return this;
    }

    public BigDecimal getRent() {
        return rent;
    }

    public Tenant setRent(BigDecimal rent) {
        this.rent = rent;
        return this;
    }

    public String getRentDate() {
        return rentDate;
    }

    public Tenant setRentDate(String rentDate) {
        this.rentDate = rentDate;
        return this;
    }

    public String getPaymentMethod() {
        return paymentMethod;
    }

    public Tenant setPaymentMethod(String paymentMethod) {
        this.paymentMethod = paymentMethod;
        return this;
    }

    public String getReferrer() {
        return referrer;
    }

    public Tenant setReferrer(String referrer) {
        this.referrer = referrer;
        return this;
    }

    @JSON(include = false)
    public String getVerifyCode() {
        return verifyCode;
    }

    public Tenant setVerifyCode(String verifyCode) {
        this.verifyCode = verifyCode;
        return this;
    }

    public String getOpenid() {
        return openid;
    }

    public Tenant setOpenid(String openid) {
        this.openid = openid;
        return this;
    }

    public boolean isFromAcivityFlag() {
        return fromAcivityFlag;
    }

    public Tenant setFromAcivityFlag(boolean fromAcivityFlag) {
        this.fromAcivityFlag = fromAcivityFlag;
        return this;
    }

    public BigDecimal getIncome() {
        return income;
    }

    public Tenant setIncome(BigDecimal income) {
        this.income = income;
        return this;
    }

    public BigDecimal getExpense() {
        return expense;
    }

    public Tenant setExpense(BigDecimal expense) {
        this.expense = expense;
        return this;
    }
}
